home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 295 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.8 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c,comp.std.c
  4. Subject: Re: division problem
  5. Date: 03 Feb 1996 16:55:31 GMT
  6. Organization: Los Alamos National Laboratory
  7. Message-ID: <TANMOY.96Feb3095531@qcd.lanl.gov>
  8. References: <31097D77.11AA@rain.org> <26JAN199622082450@erich.triumf.ca>
  9.     <4eh246$u6h@airdmhor.gen.nz> <4ej4ha$66@fountain.mindlink.net>
  10.     <DLzvGG.2rn@uns.bris.ac.uk>
  11.     <Pine.SOL.3.90.960130150923.21923F-100000@flute>
  12.     <4etjdj$fil@airdmhor.gen.nz> <mjs.823295100@hubcap>
  13. NNTP-Posting-Host: qcd.lanl.gov
  14. Mime-Version: 1.0
  15. Content-Type: text
  16. In-reply-to: mjs@hubcap.clemson.edu's message of 2 Feb 96 21:05:00 GMT
  17.  
  18. Note cross post to comp.std.c
  19.  
  20. In article <mjs.823295100@hubcap> mjs@hubcap.clemson.edu
  21. (M. J. Saltzman) writes: 
  22. <snip>
  23.    >#if -3 / 2 == -2
  24. <snip>
  25.    I'm not so sure.  Is there a guarantee that the division as done in
  26.    the compiler's preprocessing phase will give the same result as the
  27.    division done at run time?  Language lawyers?
  28.  
  29. The standard seems silent as to this: except that it says that all
  30. integer arithmetic is done as on longs. The interpretation of character
  31. constants is explicitly permitted to be different. As otherwise the
  32. rules of expression evaluation are quoted, I would say other
  33. things cannot be different ... but I doubt whether that was intended.
  34.  
  35. Cheers
  36. Tanmoy
  37. --
  38. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  39. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  40. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  41. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  42. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  43. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  44.